package com.sh.泛微;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class Java中怎么保证精度 {
    public static void main(String[] args) {
        System.out.println(0.2+0.4);   // 0.6000000000000001
        System.out.println(0.5+0.5);   // 1.0
        System.out.println(0.2+0.2);
        System.out.println(0.4+0.4);
        System.out.println(0.1+0.4);
        System.out.println(0.1+0.5);
        System.out.println(0.1+0.2);
        System.out.println(0.15+0.15);

    }
}

